Rem This program is distributed by MichTron free of charge and is not to be
Rem sold, rented or used in any way to generate profit.
Rem Modified: 87/07/22 by Bob Raper - Alert messages translated to English.
Rem Modified: 87/10/06 by Bob Raper - Open statement (for picture) changed to refer to current folder so game and picture may be in same folder. (Directory)
Rem
Hidem
@Init.dat
@Init.pictures
Do
Setcolor 15,3,0,5
Alert 2," How many players will | try to get four stones | in one line? ",1," ONE | TWO ",Ez%
Setcolor 15,2,1,0
C!=False
If Ez%=1
C!=True
Endif
Arrayfill Fw%(),0
Sput Screen$
Clr T$
Do
@Kugel.setzen(1)
@Unentschieden
@Gewonnen(1)
Exit If T$>""
If C!
@Computer.setzt
Else
@Kugel.setzen(2)
Endif
@Unentschieden
@Gewonnen(2)
Exit If T$>""
Loop
Setcolor 15,3,0,5
Alert 1,T$,1," YES | NO ",Jn%
Exit If Jn%=2
For D%=0 To 63
Sprite K$(D%,0)
Sprite K$(D%,1)
Next D%
Loop
Setcolor 0,4,4,4
Edit
'
'
'
Procedure Kugel.setzen(Sp%)
'
F!=False
Do
Mouse X%,Y%,K%
Vsync
Sprite Pfeil$,X%,Y%
If K%
Repeat
Until Mousek=0
Sprite Pfeil$
For D%=0 To 63
If X%>Bx%(D%) And X%<Bx%(D%)+14 And Y%>By%(D%)+2 And Y%<By%(D%)+16
If Fw%(D%)=0
Sprite K$(D%,Sp%-1),Bx%(D%),By%(D%)
Sound 1,12,10,4,10
Wave 0,0
Fw%(D%)=Sp%
F!=True
Endif
Endif
Next D%
Endif
Exit If F!
Loop
'
Return
'
'
Procedure Unentschieden
'
U!=True
For D%=0 To 63
If Fw%(D%)=0
U!=False
Endif
Next D%
If U!
T$=" | Draw - The play | went undecided! | Another play? "
Endif
'
Return
'
'
Procedure Gewonnen(Sp%)
'
Clr G%
For L%=0 To 75
If Fw%(Linie%(L%,0))=Sp% And Fw%(Linie%(L%,1))=Sp% And Fw%(Linie%(L%,2))=Sp% And Fw%(Linie%(L%,3))=Sp%
G%=L%+1
Endif
Next L%
If G%
Dec G%
For D%=0 To 57
Sound 1,9,No%(D%),Oktave%(D%)
Sound 2,3,No%(D%),Oktave%(D%)-1
Sound 3,2,No%(D%),Oktave%(D%)+1
Wave 7,7,3,20000,Dauer%(D%)/2
Next D%
Wave 0,0
Graphmode 3
Defline 1,1,0,0
X0%=Bx%(Linie%(G%,0))+7
Y0%=By%(Linie%(G%,0))+7
X1%=Bx%(Linie%(G%,3))+7
Y1%=By%(Linie%(G%,3))+7
P%=200/Sqr((X0%-X1%)^2+(Y0%-Y1%)^2)
A%=7
E%=0
S=-0.5
Do
Swap A%,E%
S=-S
For D=A% To E% Step S
Setcolor 8,0.7*D,0.3*D,D
Draw X0%,Y0% To X1%,Y1%
Pause P%
Next D
Exit If Inkey$>"" Or Mousek
Loop
Setcolor 8,3,0,5
T$=" | Player "+Str$(Sp%)+" has | won this time!! | Another play? "
Endif
'
Return
'
'
Procedure Computer.setzt
'
Arrayfill Bw%(),0
For L%=0 To 75
For P%=0 To 3
If Fw%(Linie%(L%,P%))=1
Inc Bw%(L%)
Endif
If Fw%(Linie%(L%,P%))=2
Sub Bw%(L%),4
Endif
Next P%
Next L%
Clr Clnr%,Cf%
Cw%=Bw%(0)
For L%=1 To 75
If Bw%(L%)>Cw%
Cw%=Bw%(L%)
Clnr%=L%
Endif
Next L%
Spez!=False
If Cw%=3
For P%=0 To 3
If Fw%(Linie%(Clnr%,P%))=0
Cf%=Linie%(Clnr%,P%)
Endif
Next P%
Else
For D%=0 To 431
If Fw%(P%(D%))=0 And Bw%(L1%(D%))=2 And Bw%(L2%(D%))=2
Spez!=True
Cf%=P%(D%)
Endif
Exit If Cf%
Next D%
Endif
Arrayfill Bw%(),0
For L%=0 To 75
For P%=0 To 3
If Fw%(Linie%(L%,P%))=2
Inc Bw%(L%)
Endif
If Fw%(Linie%(L%,P%))=1
Sub Bw%(L%),4
Endif
Next P%
Next L%
Clr Clnr%,Gf%
Gw%=Bw%(0)
For L%=1 To 75
If Bw%(L%)>Gw%
Gw%=Bw%(L%)
Clnr%=L%
Endif
Next L%
For P%=0 To 3
If Fw%(Linie%(Clnr%,P%))=0
Gf%=Linie%(Clnr%,P%)
Endif
Next P%
If Gw%<3
D!=False
For D%=0 To 431
If Fw%(P%(D%))=0 And Bw%(L1%(D%))>0 And Bw%(L2%(D%))>0
If Bw%(L1%(D%))=2 And Bw%(L2%(D%))=2
Gf%=P%(D%)
Spez!=False
D!=True
Else
If Bw%(L1%(D%))<2
For P%=0 To 3
If Fw%(Linie%(L1%(D%),P%))=0 And Linie%(L1%(D%),P%)<>P%(D%)
Gf%=Linie%(L1%(D%),P%)
Endif
Next P%
Else
For P%=0 To 3
If Fw%(Linie%(L2%(D%),P%))=0 And Linie%(L2%(D%),P%)<>P%(D%)
Gf%=Linie%(L2%(D%),P%)
Endif
Next P%
Endif
Endif
Endif
Exit If D!
Next D%
Endif
If Gw%=3 Or (Cw%<>3 And Spez!=False)
Cf%=Gf%
Endif
Fw%(Cf%)=2
Sprite K$(Cf%,1),Bx%(Cf%),By%(Cf%)
Sound 1,12,10,4-D!,10
Wave 0,0
'
Return
'
'
Procedure Init.pictures
'
Restore Farbpalette
For D%=0 To 15
Read R%,G%,B%
Setcolor D%,R%,G%,B%
Next D%
Restore Melodie
Dim No%(57),Oktave%(57),Dauer%(57)
For D%=0 To 57
Read No%(D%),Oktave%(D%),Dauer%(D%)
Next D%
Restore Pfeil
Clr Pfeil$
For D%=1 To 37
Read Dat%
Pfeil$=Pfeil$+Mki$(Dat%)
Next D%
Restore Kugel
Dim K$(63,1)
K$(0,0)=""
For D%=1 To 37
Read Dat%
K$(0,0)=K$(0,0)+Mki$(Dat%)
Next D%
K$(0,1)=K$(0,0)
Mid$(K$(0,1),7,4)=Mki$(7)+Mki$(6)
For D%=1 To 63
K$(D%,0)=K$(0,0)
K$(D%,1)=K$(0,1)
Next D%
Dim Bx%(63),By%(63)
For Z%=0 To 3
For Y%=0 To 3
For X%=0 To 3
Bx%(X%+4*Y%+16*Z%)=178+22*X%-11*Y%
By%(X%+4*Y%+16*Z%)=11*Y%+50*Z%
Next X%
Next Y%
Next Z%
Dim Fw%(63)
Arrayfill Fw%(),0
Open "I",#1,"SCORFOUR.PIC"
Screen$=Input$(32000,#1)
Close
'
Return
'
'
Procedure Init.dat
'
Dim Linie%(75,3)
Dim Bw%(75)
Restore Linien
For L%=0 To 9
For P%=0 To 3
Read Linie%(L%,P%)
Linie%(L%+10,P%)=Linie%(L%,P%)+16
Linie%(L%+20,P%)=Linie%(L%,P%)+32
Linie%(L%+30,P%)=Linie%(L%,P%)+48
Next P%
Next L%
For L%=40 To 45
For P%=0 To 3
Read Linie%(L%,P%)
Linie%(L%+6,P%)=Linie%(L%,P%)+4
Linie%(L%+12,P%)=Linie%(L%,P%)+8
Linie%(L%+18,P%)=Linie%(L%,P%)+12
Next P%
Next L%
For L%=64 To 65
For P%=0 To 3
Read Linie%(L%,P%)
Linie%(L%+2,P%)=Linie%(L%,P%)+1
Linie%(L%+4,P%)=Linie%(L%,P%)+2
Linie%(L%+6,P%)=Linie%(L%,P%)+3
Next P%
Next L%
For L%=72 To 75
For P%=0 To 3
Read Linie%(L%,P%)
Next P%
Next L%
Dim P%(431),L1%(431),L2%(431)
For L%=0 To 31
Read P%(L%),L1%(L%),L2%(L%)
P%(L%+32)=P%(L%)+16
P%(L%+64)=P%(L%)+32
P%(L%+96)=P%(L%)+48
L1%(L%+32)=L1%(L%)+10
L1%(L%+64)=L1%(L%)+20
L1%(L%+96)=L1%(L%)+30
L2%(L%+32)=L2%(L%)+10
L2%(L%+64)=L2%(L%)+20
L2%(L%+96)=L2%(L%)+30
Next L%
For L%=128 To 159
Read P%(L%),L1%(L%),L2%(L%)
P%(L%+32)=P%(L%)+1
P%(L%+64)=P%(L%)+2
P%(L%+96)=P%(L%)+3
L1%(L%+32)=L1%(L%)+1-(L1%(L%)>63)
L1%(L%+64)=L1%(L%)+2-(L1%(L%)>63)*2
L1%(L%+96)=L1%(L%)+3-(L1%(L%)>63)*3
L2%(L%+32)=L2%(L%)+1-(L2%(L%)>63)
L2%(L%+64)=L2%(L%)+2-(L2%(L%)>63)*2
L2%(L%+96)=L2%(L%)+3-(L2%(L%)>63)*3
Next L%
For L%=256 To 287
Read P%(L%),L1%(L%),L2%(L%)
P%(L%+32)=P%(L%)+4
P%(L%+64)=P%(L%)+8
P%(L%+96)=P%(L%)+12
L1%(L%+32)=L1%(L%)+1-(L1%(L%)>30)*5
L1%(L%+64)=L1%(L%)+2-(L1%(L%)>30)*10
L1%(L%+96)=L1%(L%)+3-(L1%(L%)>30)*15
L2%(L%+32)=L2%(L%)+1-(L2%(L%)>30)*5
L2%(L%+64)=L2%(L%)+2-(L2%(L%)>30)*10
L2%(L%+96)=L2%(L%)+3-(L2%(L%)>30)*15
Next L%
For L%=384 To 431
Read P%(L%),L1%(L%),L2%(L%)
Next L%
'
Return
'
'
Farbpalette:
Data 0,0,0
Data 7,3,5
Data 7,0,0
Data 4,2,3
Data 0,6,6
Data 0,5,5
Data 7,0,6
Data 6,0,5
Data 3,0,5
Data 2,3,4
Data 3,2,0
Data 7,7,0
Data 0,2,3
Data 7,0,0
Data 0,3,5
Data 2,1,0
'
'
Kugel:
Data 0,0,1,5,4
Data 1984,0,8176,0,15416,960,32652,112,32708,56,65510,24,65506,28,65506,28
Data 65506,28,65534,0,32764,0,32752,0,16320,0,7680,0,0,0,0,0
'
'
Pfeil:
Data 0,0,1,11,13
Data 63488,0,33792,30720,34816,28672,33792,30720,41472,23552,20736,3584,2176,1792,1152,768
Data 768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
'
'
Melodie:
Data 1,4,16,5,4,16
Data 8,4,48,1,5,16,8,4,32,6,4,32
Data 5,4,64,4,4,32,4,4,32
Data 5,4,32,5,4,16,8,4,16,6,4,32,6,4,16,10,4,16
Data 8,4,64,5,4,24,5,4,8,5,4,32,8,4,32
Data 1,5,32,1,5,32,1,5,16,12,4,16,10,4,16,8,4,16
Data 10,4,64,8,4,32,1,5,16
Data 12,4,64,1,5,32,8,4,32
Data 10,4,32,8,4,16,6,4,16,5,4,32,3,4,32
Data 1,4,32,3,4,32,5,4,32,5,4,32
Data 1,5,32,1,5,32,1,5,16,12,4,16,10,4,16,8,4,16
Data 10,4,64,8,4,32,1,5,16
Data 12,4,64,1,5,32,8,4,32
Data 10,4,32,3,5,32,1,5,32,12,4,32,1,5,64
'
'
Linien:
Data 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Data 0,4,8,12,1,5,9,13,2,6,10,14,3,7,11,15
Data 0,5,10,15,3,6,9,12
'
Data 0,16,32,48,1,17,33,49,2,18,34,50,3,19,35,51
Data 0,17,34,51,3,18,33,48
'
Data 0,20,40,60,12,24,36,48
'
Data 0,21,42,63,15,26,37,48,3,22,41,60,12,25,38,51
'
'
Zweier:
Data 0,0,4,1,0,5,2,0,6,3,0,7,0,0,8,3,0,9
Data 4,1,4,5,1,5,6,1,6,7,1,7,5,1,8,6,1,9
Data 8,2,4,9,2,5,10,2,6,11,2,7,10,2,8,9,2,9
Data 12,3,4,13,3,5,14,3,6,15,3,7,15,3,8,12,3,9
Data 0,4,8,12,4,9,5,5,8,9,5,9,10,6,8,6,6,9,15,7,8,3,7,9
'
Data 0,4,40,4,4,46,8,4,52,12,4,58,0,4,64,12,4,65
Data 16,14,40,20,14,46,24,14,52,28,14,58,20,14,64,24,14,65
Data 32,24,40,36,24,46,40,24,52,44,24,58,40,24,64,36,24,65
Data 48,34,40,52,34,46,56,34,52,60,34,58,60,34,64,48,34,65
Data 0,40,64,48,40,65,20,46,64,36,46,65,40,52,64,24,52,65,60,58,64,12,58,65
'
Data 0,0,40,1,0,41,2,0,42,3,0,43,0,0,44,3,0,45
Data 16,10,40,17,10,41,18,10,42,19,10,43,17,10,44,18,10,45
Data 32,20,40,33,20,41,34,20,42,35,20,43,34,20,44,33,20,45
Data 48,30,40,49,30,41,50,30,42,51,30,43,51,30,44,48,30,45
Data 0,40,44,48,40,45,17,41,44,33,41,45,34,42,44,18,42,45,51,43,44,3,43,45